<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<title>Dynamic Icons</title>
		<link href="../themes/iphone/iphone.css" rel="stylesheet"></link>
		<link href="../themes/buttons.css" rel="stylesheet"></link>
		<link href="../../../dijit/themes/tundra/tundra.css" rel="stylesheet"></link>

		<style>
			.box {
				border: 1px solid #A7C0E0;
				width: 300px;
				height: 250px;
				background-image: url(images/widget-bg.png);
				background-repeat: no-repeat;
				background-color: white;
			}
		</style>
		<script type="text/javascript" src="../../../dojo/dojo.js" djConfig="parseOnLoad: true"></script>

		<script language="JavaScript" type="text/javascript">
			//dojo.require("dojo.parser"); // Use the lightweight parser.
			dojo.require("dojox.mobile.parser");
			dojo.require("dojox.mobile");
			dojo.require("dojox.mobile.IconContainer");
			dojo.requireIf(!dojo.isWebKit, "dojox.mobile.compat");

			dojo.addOnLoad(function(){
				var btnWidget = dijit.byId("btn1");
				dojo.connect(btnWidget.domNode, "onclick", onBtnClicked);
				function onBtnClicked(e){
					var iconContainerWidget = dijit.byId("ic1");
					var itemWidget = new dojox.mobile.IconItem({
						icon: "images/icon-1.png",
						label: "new icon",
						lazy: true
					});
					itemWidget.containerNode.innerHTML = "<div dojoType='dijit._Calendar'></div>";
					iconContainerWidget.addChild(itemWidget);
				}
			});
		</script>
	</head>
	<body class="tundra">
		<div id="myhome" dojoType="dojox.mobile.View" selected="true">
			<ul id="ic1" dojoType="dojox.mobile.IconContainer" type="slide">
				<li dojoType="dojox.mobile.IconItem" label="test1" icon="images/icon-1.png" lazy="true"><div class="box"></div></li>
			</ul>
			<button id="btn1" dojoType="dojox.mobile.Button" style="width:80px;margin-left:10px">More...</button>
		</div>
	</body>
</html>
